//
//  LSZArticleDetailsManager.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/8/20.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZArticleDetailsManager.h"

@implementation LSZArticleDetailsManager
-(id)initWithArticleDetails :(NSArray *)array
{
    self = [super init];
    if (self) {
        self.mutMgArray = [[NSMutableArray alloc]init];
        NSMutableArray * arrayMg = [[NSMutableArray alloc]init];
        for (NSDictionary * diction in array) {
            LSZArticleDetailsMg * mg = [[LSZArticleDetailsMg alloc]init];
            mg.contentUrl = [NSString stringWithFormat:@"%@%@",URLTotalWeb,NullStringjudgment(NSStr(diction[@"contentUrl"]))];
            NSString * strTime = NullStringjudgment(NSStr(diction[@"publishTime"]));
            NSString *subStr = [[NSString alloc]init];
            if (strTime.length >10) {
                subStr= [strTime  substringToIndex:10];
            }else{
                subStr = strTime;
            }
            mg.publishTime = subStr;
            mg.id_id = NullStringjudgment(NSStr(diction[@"id"]));
            mg.coverUrl = [NSString stringWithFormat:@"%@%@",URLTotalWeb,NullStringjudgment(NSStr(diction[@"coverUrl"]))];
            mg.name = NullStringjudgment(NSStr(diction[@"name"]));
            if ([[diction allKeys] containsObject:@"times"]) {
                mg.times = NullStringjudgment(NSStr(diction[@"times"]));
            }
            if ([[diction allKeys] containsObject:@"counts"]) {
                mg.counts = NullStringjudgment(NSStr(diction[@"counts"]));
            }
            mg.publish = NullStringjudgment(NSStr(diction[@"publish"]));
            [arrayMg addObject:mg];
        }
        self.mutMgArray = arrayMg;
    }
    return self;
}
@end
@implementation LSZArticleDetailsMg

@end
